package com.gdkm.controller;

import java.util.List;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.gdkm.po.Student;
import com.gdkm.po.UserManagement;
import com.gdkm.po.zixun;
import com.gdkm.service.PersonCenterService;
import com.gdkm.service.UserService;
import com.gdkm.service.zixunService;

@Controller

public class Jiancontroller {
	@Autowired
	zixunService service;
	@Autowired
	PersonCenterService service1;
	@RequestMapping("/indexJ")
	public String indexJ() {
		return "indexJ";
	}
	@RequestMapping("/y")
	public String y() {
		return "y";
	}
	
	@RequestMapping("/PersonalCenter")
	public String Personalcenter() {
		return "PersonalCenter";
	}
	
	@RequestMapping("/yu")
	public String yu() {
		return "yu";
	}
	@RequestMapping("/xiangqing")
	public String xiangqing() {
		return "xiangqing";
	}
	@RequestMapping("/xiugai")
	public String xiugai() {
		return "xiugai";
	}
	
	@ResponseBody
	@RequestMapping("/list")
	public List get() {
		List<zixun> list = service.list();
		System.out.println(list);
		return list;
	}
	@ResponseBody
	@RequestMapping("/list1")
	public List get1(int id,zixun z) {
		List<zixun> list = service.list1(id);
		return list;
	}
	@ResponseBody
	@RequestMapping("/perlist")
	public List get2(HttpSession session) {
		session.getAttribute("person");
		String usercode=(String) session.getAttribute("person");
		List<UserManagement> list = service1.listl(usercode);
		return list;
	}
	
}
